package org.jwos.plugin.file.service;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

import javax.jcr.RepositoryException;

import org.jwos.platform.domain.User;
import org.jwos.plugin.file.domain.FileInfo;
import org.jwos.plugin.file.domain.FolderViewInfo;
import org.jwos.plugin.file.exception.FileException;
import org.jwos.plugin.file.util.ObservedInputStream;

public interface FileManager {
	
	public static final String NodePath_File = "file";
	
	public Map login(String sessionId) throws FileException;
	
	public FileInfo getFileInfoById(String sessionId,String fileId) throws FileException;
	
	public InputStream getFileContentById(String sessionId,String fileId) throws FileException;
	
	public InputStream getFileThumbnailById(String sessionId,String fileId) throws FileException;
	
	public List getSubFoldersByParent(String sessionId,String parentId) throws FileException;

	public List getAllFolderTree(String sessionId) throws FileException ;	
	
	public List getAllFolderTreeByUser(User user) throws FileException ;
	
	public void treeNodeCollapse(Map map);
	
	public FolderViewInfo getFolderViewById(String sessionId,String folderId) throws FileException;
	
	public List getCompletePathList(Map map);
	
	public Map getFolderIdByPath(Map map);
	
	public void registerUser(User user) throws FileException;
	
	public Map createFolder(Map map) throws FileException;	
	
	public void createFile(String sessionId,String folderId,String fileName,ObservedInputStream input) throws FileException;
	
	public void renameFile(Map map) throws FileException;
	
	public void renameFolder(Map map) throws FileException;
	
	public Map delete(Map map) throws FileException;
	
	public void copy(Map map) throws FileException;
	
	public void move(Map map) throws FileException;
	
	public Map getSharedItem(Map map) throws FileException;
	
	public void saveSharedItem(Map map) throws FileException;
	
	public Map publishFile(Map map) throws FileException;
	
	public Map publishFolder(Map map) throws FileException;
	
	public void unPublishFile(Map map) throws FileException;
	
	public void unPublishFolder(Map map) throws FileException;
	
	public List getPublishedFileListByFolderId(String folderId) throws FileException;
	
	public boolean isFileInPublishedFolder(String fileId) throws FileException;
	
	public FileInfo getFileProperties(String sessionId,String fileId);
	
	public FileInfo getFolderProperties(String sessionId,String folderId);
	
	public FileInfo getMultipleItemProperties(String sessionId,String[]fileIds,String[] folderIds);
	
	public void emailFiles(Map map) throws FileException;
	
	public List getAddressBook(Map map) throws FileException;
	
	public List getSubUsers(Map map) throws FileException;
	
	public Map getUploadObject(Map map) throws FileException;
	
	public Map getUploadStatus(Map map) throws FileException;
	
	public void saveFileManagerSetting(Map map) throws FileException;

}
